package com.example.laixunlong.control;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.laixunlong.R;

/*背景设置包括直接的属性设置,drawable文件编写,setBackgroundResource(R.drawable.filename)方法的使用*/
public class Background_beijing extends AppCompatActivity {

    Button b;
    TextView t;
    boolean tai=true;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.background_beijing);
        b=findViewById(R.id.update_beijing_1);
        t=findViewById(R.id.beijing_shiyan_1);
        b.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(tai)
                {t.setBackgroundResource(R.drawable.fangxing);tai=false;}
                else
                {t.setBackgroundResource(R.drawable.border_1px_solid_000000);tai=true;}
            }
        });
    }
}